<?php

namespace App\Module\Api\Controllers;
use App\Exceptions\Customize\ParamsException;
use App\System\Base\Services\ImageService;
use Illuminate\Support\Facades\Request;

/**
 * 上传图片
 * @package App\Module\Admin\Controllers
 */
class UploadImageController extends Controller
{
    public function index()
    {
        $image = ImageService::getInstance();
        $res = $image->apiUpload();
        if(isset($res['s']))
        {
            throw new ParamsException([
                'error_code' => $res['s'],
                'message'    =>  $res['d'],
            ]);
        }
        return apiResponse($res);
    }
}
